Longest prefix match may refer to an algorithm that is used by a network device to select an entry from a routing table associated with routing a packet. In some cases, a destination address, associated with the packet, may match one or more routing table entries. The most specific of the matching routing table entries (i.e., the entry with the highest subnet mask) is called the longest prefix match (e.g., since the most specific routing table entry is the routing table entry where the largest number of leading address bits of the destination address match those bits in the routing table entry).